package com.File;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class BufferedWriter_ {
    public static void main(String[] args) throws IOException {
        String filePath = "d:\\ok.txt";
        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(filePath));
        bufferedWriter.write("hello ,你好");
        bufferedWriter.newLine();//插入一个和系统相关的换行
        bufferedWriter.write("hello1 ,你好");
        bufferedWriter.write("hello2 ,你好");
        //new FileWriter(filePath,true)  表示以追加的方式写入
        //new FileWriter(filePath),表示以覆盖的方式写入
        bufferedWriter.close();
    }
}
